<template>
  <div class="userlist">
   <div class="divshow">
     <el-table :data="tableData" stripe style="width: 100%" border>
      <el-table-column prop="_id" label="ID" width="350px" >
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row._id }}</span>
        </template>
      </el-table-column>

      <el-table-column prop="phone" label="手机号" width="350px" >
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.phone }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="pwd" label="密码" width="350px">
         <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.pwd }}</span>
        </template>
        </el-table-column>
    </el-table>
   </div>

  <el-pagination
    layout="prev, pager, next"
    :total="total" :page-size="pageSize" @current-change="changePage">
  </el-pagination>
  </div>
</template>

<script>
import network from "@/network";
import axios from "axios";
export default {
  data() {
    return {
      pageSize: 8,
      total:0,
      tableData: [
     
    
      ],
    };
  },
  methods:{
   async changePage(page){
      console.log(page)
      let res = await network({
        url: "/pcUsers/list",
        method: "get",
        params: {
          page: page,
          limit: this.pageSize,
        },
      });
      this.tableData=res.data.rows
      this.total = res.data.total;

    }
  },
  async mounted() {
    let res = await network({
      url: "/pcUsers/list",
      method: "get",
      params: {
        page: this.page,
        limit: this.pageSize,
      },
    });
    // console.log(res);
    this.tableData = res.data.rows;
    this.total=res.data.total
    console.log(this.tableData);
  },
};
</script>

<style lang="scss" scoped>

</style>